package com.sina.shop.eureka.consume.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Created with IntelliJ IDEA.
 * Description: cloud的负载均衡配置  默认使用的是轮询方式
 * 段浩杰   2018-01-31-17:14
 */
@Configuration
public class CloudConfig {

    //负载均衡
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
